#pragma once
#include<iostream>
#include<pthread.h>
#include<ctime>
#include<functional>
#include<unistd.h>
using std::cout;
using std::endl;
// using fun = std::function<void*(void*)>;


class Thread{
    public:
    Thread(void*(*ptr)(void*))
    {
        pthread_create(&tid,nullptr,ptr,nullptr);
        _name = "Mythread";
    }
    ~Thread()
    {
       
    }
    std::string name()
    {
        return _name;
    }
    uint64_t get_id()
    {
        return pthread_self();
    }

    void join()
    {
        pthread_join(tid,nullptr);
    }
private:
   pthread_t tid;
   std::string _name;
   uint64_t start_time;
   bool IsRunning;
};